//
//  CFTableViewCell.m
//  OneCreditTreasure
//
//  Created by iOS Tedu on 16/8/29.
//
//

#import "CFTableViewCell.h"

#define cellWidth kScreenW / 4
#define MyOwnLBSettings(label)\
label.numberOfLines = 0;\
label.textAlignment = NSTextAlignmentCenter;\
label.font = [UIFont systemFontOfSize:16 * AUTO_WIDTH];

@implementation CFTableViewCell
#pragma mark - 生命周期 life cycle
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

#pragma mark - 懒加载 lazy loading
- (UILabel *)leftLB {
    if (_leftLB == nil) {
        _leftLB = [UILabel new];
        [self.contentView addSubview:_leftLB];
        [_leftLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(30);
            make.top.equalTo(8);
            make.bottom.equalTo(-8);
            make.width.equalTo(cellWidth);
        }];
        MyOwnLBSettings(_leftLB);
        _leftLB.textColor = [UIColor lightGrayColor];
    }
    return _leftLB;
}

- (UILabel *)centerLB {
    if (_centerLB == nil) {
        _centerLB = [UILabel new];
        [self.contentView addSubview:_centerLB];
        [_centerLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.leftLB.mas_right).equalTo(8);
            make.top.equalTo(8);
            make.bottom.equalTo(-8);
            make.width.equalTo(cellWidth);
        }];
        MyOwnLBSettings(_centerLB);
        _centerLB.textColor = [UIColor lightGrayColor];
    }
    return _centerLB;
}

- (UILabel *)rightLB {
    if (_rightLB == nil) {
        _rightLB = [UILabel new];
        [self.contentView addSubview:_rightLB];
        [_rightLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.centerLB.mas_right).equalTo(8);
            make.top.equalTo(8);
            make.bottom.equalTo(-8);
            make.width.equalTo(cellWidth);
        }];
        MyOwnLBSettings(_rightLB);
        _rightLB.textColor = [UIColor lightGrayColor];
    }
    return _rightLB;
}
@end
